package com.mjfeed.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

/**
 * @description 物流公司
 * @author zhaominglei
 * @date 2014年10月19日
 */
@Entity
@Table(name="feed_delivery_corp")
public class DeliveryCorp extends OrderEntity {
	private static final long serialVersionUID = -2575849284049115756L;

	/** 名称 */
	private String name;

	/** 网址 */
	private String url;

	/** 代码 */
	private String code;

	/** 发货单 */
	private List<Shipping> shippings = new ArrayList<Shipping>();
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@OneToMany(mappedBy="deliveryCorp", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
	@OrderBy("createDate asc")
	public List<Shipping> getShippings() {
		return shippings;
	}

	public void setShippings(List<Shipping> shippings) {
		this.shippings = shippings;
	}
	
}
